#ifndef _SYMBOLTABLE_H_
#define _SYMBOLTABLE_H_
#include "record.h"
#include <vector>
class SymbolTable;

struct Symbol
{
	// The address of the symbol in memory
	int address;
	// The record which the symbol stores in memory
	Record record;
	// Constructor
	Symbol(int address, Record record);
	Symbol();
};

class SymbolTable
{
private:
	// The literal symbol table
	vector<Symbol> table;
	// The current memory address, used for adding more symbols to program memory table
	int memoryAddress;
	// The current internal location of the symbol table
	int location;
public:
	SymbolTable();
	// Return the memory location of a record
	int GetAddress(const Record & record) const;
	// Insert a symbol into the symbol table
	void Insert(const Symbol &);
	// Insert a record into the symbol table
	void Insert(const Record &);
	// Print the symbol table to a file
	void Print(const string& fileName);
	// Get a record which is stored in the symbol table
	Record GetRecord(const Record & record) const;
};
#endif // _SYMBOLTABLE_H_